home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 3 code / Surf's Up! / Interfaces / CIncludes / CTBUtils.h < prev    next >
Encoding:
Text File  |  1989-11-17  |  3.5 KB  |  175 lines  |  [TEXT/MPS ]

  1. //
  2. //        CTBUtils.h
  3. //        C interface to the Communications Toolbox Utilities
  4. //
  5. //        Copyright © Apple Computer, Inc.  1988, 1989
  6. //        All rights reserved.
  7. //
  8. //
  9.  
  10. #ifndef __CTBUTILS__
  11. #define __CTBUTILS__
  12.  
  13. #ifndef    __MEMORY__
  14. #include    <Memory.h>
  15. #endif
  16.  
  17. #ifndef __PACKAGES__
  18. #include    <Packages.h>
  19. #endif
  20.  
  21. #ifndef __APPLETALK__
  22. #include <AppleTalk.h>
  23. #endif
  24.  
  25. //    version of Comm Toolbox Utilities
  26. #define    curCTBUVersion            1
  27.  
  28. //    Error codes/types
  29. typedef        OSErr    CTBUErr;
  30.  
  31. #define        ctbuGenericError    -1
  32. #define        ctbuNoErr            0
  33.  
  34. //    Dialog Item List Manipulation Constants
  35. typedef short DITLMethod;
  36. enum {
  37.     overlayDITL,
  38.     appendDITLRight,
  39.     appendDITLBottom
  40. };
  41.  
  42. //    Choose return codes
  43. enum {
  44.     chooseDisaster = -2,
  45.     chooseFailed,
  46.     chooseAborted,
  47.     chooseOKMinor,
  48.     chooseOKMajor,
  49.     chooseCancel
  50. };
  51.  
  52. //    NuLookup return codes
  53. enum {
  54.     nlOk,
  55.     nlCancel,
  56.     nlEject
  57. };
  58.     
  59. //    Name filter proc return codes
  60. enum {
  61.     nameInclude = 1,
  62.     nameDisable,
  63.     nameReject
  64. };
  65.     
  66. //    Zone filter proc return codes
  67. enum {
  68.     zoneInclude = 1,
  69.     zoneDisable,
  70.     zoneReject
  71. };
  72.     
  73. //    Values for hookProc items
  74. #define        hookOK                1
  75. #define        hookCancel             2
  76. #define        hookOutline            3
  77. #define        hookTitle            4
  78. #define        hookItemList        5
  79. #define        hookZoneTitle        6
  80. #define        hookZoneList        7
  81. #define        hookLine            8
  82. #define        hookVersion            9
  83. #define        hookReserved1        10
  84. #define        hookReserved2         11
  85. #define        hookReserved3        12
  86. #define        hookReserved4        13
  87. //    "virtual" hookProc items
  88. #define        hookNull            100
  89. #define        hookItemRefresh        101
  90. #define        hookZoneRefresh        102
  91. #define        hookEject            103
  92. #define        hookPreflight        104
  93. #define        hookPostflight        105
  94. #define        hookKeyBase            1000
  95.  
  96.  
  97. //    Popup Menu CDEF constants
  98. #define        popupMenuCDEFproc    1008
  99.  
  100. //    Popup Control Variation Codes
  101. enum {
  102.     popupFixedWidth        = 1 << 0,
  103.     popupUseCQD            = 1 << 1,
  104.     popupUseAddResMenu    = 1 << 2,
  105.     popupUseWFont        = 1 << 3
  106. };
  107.  
  108. //    Popup Title Characteristics
  109. enum {
  110.     popupTitleBold        = 1 << 8,
  111.     popupTitleItalic    = 1 << 9,
  112.     popupTitleUnderline    = 1 << 10,
  113.     popupTitleOutline    = 1 << 11,
  114.     popupTitleShadow    = 1 << 12,
  115.     popupTitleCondense    = 1 << 13,
  116.     popupTitleExtend    = 1 << 14,
  117.     popupTitleNoStyle    = 1 << 15
  118.  
  119. };
  120. #define        popupTitleLeftJust        0x0000
  121. #define        popupTitleCenterJust    0x0001
  122. #define        popupTitleRightJust        0x00FF
  123.  
  124.  
  125. //    NuLookup structures/constants
  126. struct NLTypeEntry {
  127.     Handle hIcon;
  128.     Str32 typeStr;
  129. };
  130.  
  131. #ifndef __cplusplus
  132. typedef struct NLTypeEntry NLTypeEntry;
  133. #endif
  134.  
  135. typedef NLTypeEntry NLType[4];
  136.  
  137. struct LookupReply {
  138.     EntityName    theEntity;
  139.     AddrBlock    theAddr;
  140. };
  141.  
  142. #ifndef __cplusplus
  143. typedef struct LookupReply LookupReply;
  144. #endif
  145.  
  146. typedef pascal short (*nameFilterProcPtr)(EntityName theEntity);
  147. typedef pascal short (*zoneFilterProcPtr)(Str32 theZone);
  148.  
  149. #ifdef __safe_link
  150. extern "C" {
  151. #endif
  152. extern pascal CTBUErr    InitCTBUtilities(void);
  153. extern pascal short     CTBGetCTBVersion(void);
  154.  
  155. extern pascal void        AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method);
  156. extern pascal short        CountDITL(DialogPtr theDialog);
  157. extern pascal void        ShortenDITL(DialogPtr theDialog, short numberItems);
  158.  
  159. extern pascal short     NuLookup(Point where, const Str255 prompt, short numTypes, 
  160.                               NLType typeList, nameFilterProcPtr nameFilter, 
  161.                               zoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc,
  162.                               LookupReply *theReply);
  163.  
  164. extern pascal short     NuPLookup(Point where, const Str255 prompt, short numTypes, 
  165.                               NLType typeList, nameFilterProcPtr nameFilter, 
  166.                               zoneFilterProcPtr zoneFilter, DlgHookProcPtr hookProc, 
  167.                               long userData, short dialogID,
  168.                               ModalFilterProcPtr filterProc, 
  169.                               LookupReply *theReply);
  170.                               
  171. #ifdef __safe_link
  172. }
  173. #endif
  174.  
  175. #endif __CTBUTILS__